package cn.beyond.vehicleManagement.dao;

import cn.beyond.vehicleManagement.pojo.SysRole;
import cn.beyond.vehicleManagement.pojo.SysUser;
import cn.beyond.vehicleManagement.util.DataBaseUtil;

import java.util.List;
import java.util.Map;

public class RoleDao {
    DataBaseUtil<SysRole> userDao=new DataBaseUtil<>();

    /**
     * 添加角色
     * @return
     */
    public int addRole(SysRole sysRole){
        return    userDao.addUtil(sysRole,"sys_role");
    }

    /**
     * 删除用户
     * @param obj
     * @param column
     * @return
     */
    public int deleteRole(Object obj,String column){
        return userDao.delByIdUtil(obj,"sys_role",column);

    }

    /**
     * 修改用户
     * @return
     */
    public int update(SysRole sysRole){
        return  userDao.updateByidUtil(sysRole,"sys_role");
    }

    /**
     * 查询结果返回单条记录
     * @param selectmap
     * @return
     */
    public SysRole selectUserByOne(SysRole sysRole, Map<String, Object> selectmap){
        return userDao.selectONE(sysRole,"sys_role",selectmap);
    }

    /**
     * 查询结果返回多条记录
     * @param selectmap
     * @return
     */
    public List<SysRole> selectUserByCondition(SysRole sysRole, Map<String, Object> selectmap){
        return  userDao.selectAll(sysRole,"sys_role",selectmap);
    }
}
